#!/usr/bin/env python
# -*-coding:utf-8 -*-


class _Dev:
    def __init__(self):
        pass

    # 爬虫IP代理池地址
    PROXY_ADDRESS = "http://10.10.214.32:9999"
    # 消息队列地址
    MESSAGE_SERVER_ADDRESS = "http://10.10.214.32:1090"
    # 爬虫监控平台地址
    MONITOR_ADDRESS = 'http://127.0.0.1:9090'
    # 爬虫配置信息API
    SPIDER_CONFIG_API = '/api/getAllSpiderConfigList'
    # 心跳监控回调API
    HEARTBEAT_API = '/api/heartBeatReport'
    # 爬虫下载量汇总上报API
    SPIDER_SUMMARY_API = '/api/spiderSummaryReport'
    # OCR打码地址
    OCR_SERVER_ADDRESS = 'http://127.0.0.1:1111/captcha/icp'
    # Redis服务地址
    REDIS_HOST = '172.31.0.123'
    REDIS_AUTH = ''
    REDIS_PORT = 6379
    # MongoDB数据库地址
    MONGO_ADDRESS = ""
    # 企业信息库
    MONGO_DATABASE = ""
    # 日志库
    MONGO_LOG = "logs"
    # Mysql数据地址
    MYSQL_HOST = ''
    MYSQL_PORT = 3306
    MYSQL_DB = ''
    MYSQL_USER = ''
    MYSQL_PASSWORD = ''

    # 爬虫数据回传接口
    CALLBACK_ADDRESS = 'http://10.12.112.54:7880'
    CALLBACK_API = '/hvalue/spider/sendData'


class _Online:
    def __init__(self):
        pass

    # 爬虫IP代理池地址
    PROXY_ADDRESS = "http://10.10.214.32:9999"
    # 消息队列地址
    MESSAGE_SERVER_ADDRESS = "http://10.10.214.32:1090"
    # 爬虫监控平台地址
    MONITOR_ADDRESS = 'http://10.10.214.33:9090'
    # 爬虫配置信息API
    SPIDER_CONFIG_API = '/api/getAllSpiderConfigList'
    # 心跳监控回调API
    HEARTBEAT_API = '/api/heartBeatReport'
    # 爬虫下载量汇总上报API
    SPIDER_SUMMARY_API = '/api/spiderSummaryReport'
    # OCR打码地址
    OCR_SERVER_ADDRESS = 'http://127.0.0.1:1111/captcha/icp'
    # Redis服务地址
    REDIS_HOST = ''
    REDIS_AUTH = ''
    REDIS_PORT = 6379
    # MongoDB数据库地址
    MONGO_ADDRESS = ""
    # 企业信息库
    MONGO_DATABASE = "entity"
    # 日志库
    MONGO_LOG = "logs"
    # Mysql数据地址
    MYSQL_HOST = ''
    MYSQL_PORT = 3306
    MYSQL_DB = ''
    MYSQL_USER = ''
    MYSQL_PASSWORD = ''


class Env:
    __ENV = {
        "online": _Online,
        "dev": _Dev
    }

    def __init__(self):
        pass

    @staticmethod
    def get_env(env):
        return Env.__ENV[env.lower()]
